A flash memory is known to have characters of lower power consumpation, fast data access rate, and can endure vibration and/or movement and hence is a kind of data storing media with highly stability and security. For the flash memory, the way of data programmed or erased is generally based on block by block. Once, the data are stored in the flash memory, no electrical power is demanded to preserve the data for over 10 years. This advantage makes other conventional portable stored device inferior. For instance, the hard disk driver or soft disk driver all require a reading head to read or write the data on the specific position of the optical or magnetic media disk rotating and bring by a stepping motor. In general, these types of data storage devices are not secure and inferior to the portable due to the vibration.
Hence, a data storage apparatus without stepping motor such as flash memory has a sufficient competitiveness to become a massive hit in the present and future. For example, the electrical merchandise such as DSC (digital still camera), mp3 player, hand-held computer or PDA (personal digital assistant), cellular phone, flash memory is a one of most critical members.
Generally, the basic architecture of a flash memory apparatus is blocks therein. Each block may contain 32, 64, 128 or more pages or sectors and each page consists of 1 or 4 virtual sector(s) in accordance the memory specification. Each sector, typically, is constituted 512×8 cells and thus can store 512 bytes. The virtual sector herein is distinct from the physical sector. Physical sectors may contain defect(s) in some bocks and result in data therein unstable. Hence, while formatting the flash memory, those blocks are unusable and will be marked. The virtual sectors are those sectors exclude sectors in the bad blocks. The virtual sectors are then renumbered by control chip.
On the other hand, the basic unit of data access for a host is not a block but a logic sector. Therefore, the host communicating with the flash memory apparatus demands a conversion table of logic sectors to virtual sectors.
For example: assume each block contains 64 pages and each page has 4 virtual sectors. The formula are as follows:Block number=quotient of (logic sector number/64 pages*4 virtual sectors)virtual sector number remainder of (logic sector number/64 pages*4 virtual sectors)
The flash memory can only be used after formatting. It is carried out in a manner of block by block electrically erasing electrical charges in the floating gate. The data writing or programming is by storing the charges into predetermined memory cells of the target block. Therefore, to satisfy the protocol of the conversion table of logic sectors to virtual sectors, the data stored in the target block has to move or copy frequently to stratify the protocol the conversion table. It is not only detrimental to the lifetime of the flash memory but also disadvantage to the writing efficiency.
An object of the present is to introduce concepts of screen table and virtual block to physical block table (V2P table). The screen virtual sector table keeps tracing the virtual sector number versus logic sector number and the V2P table having FSP (free sector point) to record the number of free pages make the host or control chipset know the status of available pages in the target block. With these tables, the data programming is no longer based on block but based on page or virtual sector. The data in the buffer is written into the target block not from a target page in accordance with the conversion table but from a lowest page if the target block is free. In another situation, the data in the buffer can still be written into a target block if the target pages are available.